home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 1994 November / SOFM_Nov1994.bin / mac / General Interest / CK2.2 / CK File Structure < prev    next >
Text File  |  1990-10-01  |  3KB  |  101 lines

  1.  
  2. This document describes the structure of a CK document file.  It is supplied for the convenience of programmers or sophisticated user who would like to extract information from CK documents.
  3.  
  4. TYPES
  5. ===============================================================================
  6. The file structure uses the following types:
  7.  
  8.  
  9. AmtString        =    STRING[14];
  10. CatString        =    STRING[17];
  11. PayeeString        =    STRING[90];
  12. MemoString        =    STRING[45];
  13.  
  14. DateRec            =    RECORD
  15.         Month:            INTEGER;
  16.         Day:                INTEGER;
  17.         Year:                INTEGER;
  18. END;
  19.  
  20.  
  21. CatRec            =    RECORD
  22.         NextCat:            Handle;
  23.         CatName:            CatString;
  24.         Sign:                INTEGER;
  25.         NumEntries:        INTEGER;
  26.         CatTotal:        LONGINT;
  27.         NumCleared:        INTEGER;
  28.         AmtCleared:        LONGINT;
  29.         AutoAmt:            LONGINT;
  30.         AutoPayee:        PayeeString;    
  31.         AutoON:            BOOLEAN;
  32.         PrevCat:            Handle;
  33.         CatNum:            Integer;
  34.         BudgetAmt:        Longint;
  35.         BudgetON:        Boolean;
  36. END;
  37.  
  38.  
  39. EntRec            =    RECORD
  40.         NextEnt:            Handle;
  41.         EntNum:            INTEGER;            { A check #, -1 = dashes, -2 = blanks }
  42.         Payee:            PayeeString;
  43.         Memo:                MemoString;
  44.         Amount:            LONGINT;
  45.         Cat:                INTEGER;            { # of categ. entry belongs to }
  46.         Date:                DateRec;
  47.         Cleared:            Boolean;            { Posted/Not Posted }
  48.         Locked:            Boolean;
  49.         TaxFlag:            Boolean;
  50.         PrevEnt:            Handle;
  51.         RecordNum:        Integer;            { # entry was added to file }
  52. END;
  53.  
  54.  
  55. HeaderRec        =    RECORD
  56.         NumRecs:            INTEGER;        { # of entries }
  57.         NumCleared:        INTEGER;        { # entries posted }
  58.         NumCats:            INTEGER;        { # of categories }
  59.         Balance:            LONGINT;        { Overall balance }
  60.         RcnclBal:        LONGINT;        { Balance amt of posted entries }
  61.         CredTotal:        LONGINT;        { Total credit entries }
  62.         DebTotal:        LONGINT;        { Total debit entries }
  63.         FirstEnt:        Handle;        { Handle to 1st entry }
  64.         FirstCat:        Handle;        { Handle to 1st category }
  65.         CurrEnt:            INTEGER;        { Entry we're on now }
  66.         CatEdit:            INTEGER;        { # of categ being edited }
  67.         LastEntNum:        INTEGER;        { Last CkNum used }
  68.         CKVersion:        INTEGER;        { What version is this file? }
  69.         LastRecNum:        Longint;
  70.         lastDate:        DateRec;
  71. END;
  72.  
  73.  
  74.  
  75. File Structure
  76. ===============================================================================
  77.  
  78. A CK document file has the following structure:
  79.  
  80. *    A header of type HeaderRec
  81. *    An array of records of type CatRec
  82. *    An array of records of type EntRec
  83.  
  84.  
  85.  
  86. Amounts
  87. ===============================================================================
  88.  
  89. All CK amounts are Longint values that are interpreted as cents values; that is, a value of 100 indicates an amount of $1.00.
  90.  
  91. All amounts are positive numbers.  The credit or debit status of an entry's category is used to determine if the amount is positive or negative.
  92.  
  93.  
  94. Category Numbers
  95. ===============================================================================
  96.  
  97. The EntRec type contains an elements, "Cat".  This is the zero-based number of the category the entry belongs to.  Categories are stored in the file in order.
  98.  
  99.  
  100.  
  101.